package com.qinhailin.portal.dbm.service;

import java.util.List;

import com.qinhailin.portal.dbm.model.DTSchedule;

/** 2019-11-23 21:28:46 批量生成 harrydeep@wardyan.top **/
public class DTScheduleServiceImpl extends MasterServiceImpl<DTSchedule> {

	public DTScheduleServiceImpl() {super(DTSchedule.dao);}
/**
	public java.util.List<DTSchedule> list(Integer rCustID) {
		return this.List(this.sql + " WHERE rCust_ID = ?", rCustID);
	}

	public DTSchedule find(Integer rCustID, Integer rQueryID) {
		return this.findBySql(this.sql + " WHERE rCust_ID = ? AND rQuery_ID = ?", rCustID, rQueryID);
	}
**/
	public List<DTSchedule> list(Integer rCustID){
		return this.List(this.sql + " WHERE rCust_ID = ?", rCustID);
	}
	
	public DTSchedule find(Integer rCustID, Integer rQueryID) {
		return this.findBySql(this.sql + " WHERE rCust_ID = ? AND rQuery_ID = ? AND sStatus = 1", rCustID, rQueryID);
	}
	
	public void delete(Integer rCustID, Integer xStatus) {
		List<DTSchedule> ss = this.list(rCustID);
		if(ss != null) {
			for(DTSchedule s : ss) {
				if(s.getXStatus() != null && s.getXStatus().equals(xStatus))
					this.delete(s);
			}
		}
	}
}
